<ion-header class="header schedule-header-self" id="schedule-header-self">
    <ion-toolbar class="fir-toolbar">
        <!--<ion-buttons start>-->
            <!--<button ion-button icon-only (click)="backButtonClick($event)">-->
                <!--<i class="toolbar-back"></i>-->
            <!--</button>-->
        <!--</ion-buttons>-->
        <ion-title>
            日程
        </ion-title>
        <ion-buttons end>
            <button ion-button icon-only adpmenutoggle>
                <i class="toolbar-menu"></i>
            </button>
        </ion-buttons>
    </ion-toolbar>
    <ion-toolbar class="sec-toolbar">
        <ion-buttons class="start">
            <button class="button-date" ion-button icon-only (click)="openDatetime()">
                {{year}}年{{month}}月
                <span style="padding-left: 2.5vw">▾</span>
            </button>
        </ion-buttons>
        <ion-buttons class="end">
            <button class="button-today" ion-button icon-only (click)="goToday()">
                今天
            </button>
        </ion-buttons>
        <adp-calendar-month [actData]="monthData" #calendar (onDaySelect)="onDaySelect($event)"></adp-calendar-month>
    </ion-toolbar>
</ion-header>

<ion-content class="schedule-content-self" id="schedule-content">
    <!--<div class="cross-line"></div>-->
    <ion-fab class="cross-line">
        <button ion-fab style="display: none"></button>
    </ion-fab>
    <!--<div class="no-list" *ngIf="dayList.length===0&&loading===false">无日程</div>-->
    <div *ngIf="dayList.length===0&&loading===false" class="no-data">
        <div class="no-data-img"><img src="./assets/images/common/icon_nodata.png"></div>
        <div class="no-data-txt">没有相关数据</div>
    </div>
    <ion-list [ngClass]="sixLine?'six-line':''" *ngIf="viewDataStatus">
        <div class="sliding-container" *ngFor="let item of dayList">
            <div class="side-line" *ngIf="getStyleTime(item.startTime,item.endTime)==='isNow'"></div>
            <ion-item-sliding #slidingItem>
                <ion-item class="schedule-item" [ngClass]="getStyleTime(item.startTime,item.endTime)"
                          (click)="goToDetail(item.groupId,item)">
                    <div class="item-left">
                        <div class="time" *ngIf="isAllDay(item)">
                            <span class="starttime">全&nbsp;&nbsp;天</span>
                        </div>
                        <div class="time" *ngIf="this.isCurrentDay(item)">
                            <span class="starttime">{{moment(item.startTime*1000).format('HH:mm')}}</span>
                            <span>-</span>
                            <span class="endtime">{{moment(item.endTime*1000).format('HH:mm')}}</span>
                        </div>
                        <div class="time" *ngIf="this.isStartDay(item)">
                            <span class="starttime">{{moment(item.startTime*1000).format('HH:mm')}}</span>
                        </div>
                        <div class="time" *ngIf="this.isEndDay(item)">
                            <span class="starttime">结&nbsp;&nbsp;束</span>
                            <span>-</span>
                            <span class="endtime">{{moment(item.endTime*1000).format('HH:mm')}}</span>
                        </div>
                        <div class="schedule-title" [ngClass]="item.type!==1?'sys':''"><span
                            *ngIf="item.type!==1">[系统]</span>{{item.name}}
                        </div>
                    </div>
                    <div *ngIf="item.reminder!==1" class="clock-ring">
                        <i></i>
                    </div>
                </ion-item>
                <ion-item-options side="right" *ngIf="item.type===1;">
                    <button (click)="deleteSchedule(item,slidingItem)" ion-button>
                        <i class="del"></i>
                    </button>
                </ion-item-options>
            </ion-item-sliding>
        </div>

        <div class="bottom-blank"></div>
    </ion-list>
    <ion-fab class="fab-add" (click)="goToAddSchedule()">
        <button ion-fab>
            <i class="add"></i>
        </button>
    </ion-fab>
    <ion-item style="opacity: 0;height: 0;width: 0;">

        <ion-datetime #datetimePicker cancelText="取消" doneText="完成" min="2010" max="2100" pickerFormat="YYYY/MM"
                      yearValues="{{yearList}}"
                      [pickerOptions]="pickerOptions"
                      displayFormat="YYYY/MM" [(ngModel)]="datetime" (ionChange)="selectDatetime($event)">
        </ion-datetime>
    </ion-item>
    <ion-fab class="fab-bottom-shadow">
        <button ion-fab style="display: none"></button>
    </ion-fab>
    <!--选择删除方式-->
    <ion-item style="width: 0;height: 0">
        <ion-select #delRule interface="action-sheet" cancelText="取消" okText="确定">
            <ion-option *ngFor="let item of delRuleOption" (ionSelect)="selDelRule(item.value)"  [value]=item.value>{{item.str}}</ion-option>
        </ion-select>
    </ion-item>
</ion-content>
